package cn.cs.service;

import cn.cs.mapper.CapitalPoolTypeMapper;
import cn.cs.pojo.CapitalPoolType;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@RestController
public class CapitalPoolTypeService {

    @Resource
    private CapitalPoolTypeMapper capitalPoolTypeMapper;

    @RequestMapping(value = "/getCapitalPoolTypeById", method = RequestMethod.POST)
    public CapitalPoolType getCapitalPoolTypeById(@RequestParam("id") String id) throws Exception{
        return capitalPoolTypeMapper.getCapitalPoolTypeById(id);
    }

    @RequestMapping(value = "/getCapitalPoolTypeListByMap", method = RequestMethod.POST)
    public List<CapitalPoolType> getCapitalPoolTypeListByMap(@RequestBody Map<String, Object> param) throws Exception{
        return capitalPoolTypeMapper.getCapitalPoolTypeListByMap(param);
    }

    @RequestMapping(value = "/getCapitalPoolTypeCountByMap", method = RequestMethod.POST)
    public Integer getCapitalPoolTypeCountByMap(@RequestBody Map<String, Object> param) throws Exception{
        return capitalPoolTypeMapper.getCapitalPoolTypeCountByMap(param);
    }

    @RequestMapping(value = "/addCapitalPoolType", method = RequestMethod.POST)
    public Integer addCapitalPoolType(@RequestBody CapitalPoolType capitalPoolType) throws Exception{
        return capitalPoolTypeMapper.insertCapitalPoolType(capitalPoolType);
    }

    @RequestMapping(value = "/modifyCapitalPoolType", method = RequestMethod.POST)
    public Integer modifyCapitalPoolType(@RequestBody CapitalPoolType capitalPoolType) throws Exception{
        return capitalPoolTypeMapper.updateCapitalPoolType(capitalPoolType);
    }

    @RequestMapping(value = "/deleteCapitalPoolTypeById", method = RequestMethod.POST)
    public Integer deleteCapitalPoolTypeById(@RequestParam("id") String id) throws Exception{
        return capitalPoolTypeMapper.deleteCapitalPoolTypeById(id);
    }

}
